abstract class Shape implements Comparable<Shape>
{
    final double PI = 3.14;
    abstract public double getArea();
    abstract public double getPerimeter();

    @Override
    public int compareTo(Shape o) {
        if (this.getArea() > o.getArea())
            return 1;
        else if (this.getArea() < o.getArea())
            return -1;
        else
        {
            if (this.getPerimeter()>o.getPerimeter())
                return 1;
            else if (this.getPerimeter() < o.getPerimeter())
                return -1;
            else
                return 0;
        }


    }
}